unit Form_Second;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm2 = class(TForm)
    procedure FormShow(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
    procedure CreateParams(var Params: TCreateParams); override;
  public
    { Public declarations }
  end;

procedure ProFormSecond;
var
  Form2: TForm2;

implementation

{$R *.dfm}
procedure ProFormSecond;
begin
  try
    if Form2=nil then
    begin
      Form2:=TForm2.Create(Application);
    end;
    Form2.Show;
    Form2.WindowState:=wsMaximized;
  finally

  end;

end;

{ TForm2 }

procedure TForm2.CreateParams(var Params: TCreateParams);
begin
  Inherited CreateParams(Params);
  Params.WndParent := GetDesktopWindow;
end;

procedure TForm2.FormShow(Sender: TObject);
begin
  ShowMessage('True');
end;

procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  FreeAndNil(Form2);
end;

end.
